//页面滚动到指定的元素
function elementPosition(obj) {
    var curleft = 0, curtop = 0;
    if (obj.offsetParent) {
        curleft = obj.offsetLeft;
        curtop = obj.offsetTop;
        while (obj = obj.offsetParent) {
            curleft += obj.offsetLeft;
            curtop += obj.offsetTop;
        }
    }
    return { x: curleft, y: curtop };
}
function ScrollToControl(id) {
    var elem = document.getElementById(id);
    var scrollPos = elementPosition(elem).y;
    scrollPos = scrollPos - document.documentElement.scrollTop;
    var remainder = scrollPos % 50;
    var repeatTimes = (scrollPos - remainder) / 50;
    ScrollSmoothly(scrollPos, repeatTimes);
    window.scrollBy(0, remainder);
}
var repeatCount = 0;
var cTimeout;
var timeoutIntervals = new Array();
var timeoutIntervalSpeed;
function ScrollSmoothly(scrollPos, repeatTimes) {
    if (repeatCount < repeatTimes) {
        window.scrollBy(0, 50);
    }
    else {
        repeatCount = 0;
        clearTimeout(cTimeout);
        return;
    }
    repeatCount++;
    cTimeout = ScrollSmoothly(scrollPos, repeatTimes);
}
//页面滚动到指定的元素END


var swiper = new Swiper('.swiper-container', {
    spaceBetween: 30,
    loop:true,
    effect: 'fade',
    autoplay: {
        delay: 2500,
        disableOnInteraction: false,
    },
    pagination: {
      el: '.swiper-pagination',
      clickable: true,
    }
});
$('#nav li').eq(0).click(function(){
    window.location.href="/index.html";
})
$('#nav li').eq(1).click(function(){
    window.location.href="/about.html";
})
$('#nav li').eq(2).click(function(){
    window.location.href="/news.html";
})
$('#nav li').eq(3).click(function(){
    window.location.href="/show.html";
})
$('#nav li').eq(8).click(function(){
    window.location.href="/message.html";
})
$('#left_ul li').eq(0).click(function(){
    window.location.href="/about.html";
})
$('#left_ul li').eq(1).click(function(){
    window.location.href="/news.html";
})

$('#bottom_list li').eq(0).click(function(){
    window.location.href="/index.html";
})
$('#bottom_list li').eq(2).click(function(){
    window.location.href="/about.html";
})
$('#bottom_list li').eq(4).click(function(){
    window.location.href="/news.html";
})
$('#bottom_list li').eq(6).click(function(){
    window.location.href="/show.html";
})
$('#bottom_list li').eq(16).click(function(){
    window.location.href="/message.html";
})
